/*
 * @Author: shawnXiao
 * @Date: 2021-12-18 21:16:31
 * @LastEditTime: 2021-12-19 22:33:56
 * @FilePath: /vue3-vite2-ts-antdv/src/router/index.ts
 */
// @/router/index.ts
import { createRouter,createWebHashHistory,RouteRecordRaw} from "vue-router";

const asyncImport = (file: string) => () => import('../views/' + file + '.vue')
const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "home",
    component:  asyncImport('Home/index')
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})

router.beforeEach((to, from) => {
    // to.path = '/login'
    return true
})

export default router;
